import { request, requestFy } from "@/utils/request";

// 获取运输计划列表
export function getTranPlanList(data) {
  return request({
    url: "/queue/trans-plan-mgr/page",
    headers: {
      isToken: false,
    },
    method: "GET",
    data: data,
  });
}
// 销售运单审核前查询是否来自运输计划
export function getPlanFromWhere(waybillno) {
  return requestFy({
    url: "/coal-order/get-plan-info-by-plan-no/" + waybillno,
    method: "GET",
    headers: {
      isToken: false,
    },
  });
}
// 获取拉货运单列表
export function getOrderLists(data) {
  return requestFy({
    url: "/wechat/review-order-from-applet",
    headers: {
      isToken: false,
    },
    method: "POST",
    data: data,
  });
}

// 获取运输计划列表
export function getCodeList(data) {
  return requestFy({
    url: `/purchase-coal-send-car/jl-qrcode?content=${data.content}?appid=wx509f810f5fb82353&path=/pages/order-receiving/order-receiving?planId=${data.planNo}&tenantId=${data.enterId}#wechat-redirect`,
    headers: {
      isToken: false,
    },
    method: "GET",
  });
}

// 预约调价分页
export function reservaPricePage(data) {
  return request({
    url: `/queue/appointment-price-adjustment/page`,
    headers: {
      isToken: false,
    },
    method: "GET",
    data: data,
  });
}
// 新增预约调价
export function createreservaPrice(data) {
  return request({
    url: `/queue/appointment-price-adjustment/create`,
    headers: {
      isToken: false,
    },
    method: "POST",
    data: data,
  });
}
// 作废预约调价
export function cancelreservaPrice(id) {
  return request({
    url: `/queue/appointment-price-adjustment/cancel?id=${id}`,
    headers: {
      isToken: false,
    },
    method: "GET",
  });
}

// 获取拉货运单列表(销售)
export function getSaleWaybillPage(params) {
  return request({
    url: "/queue/sale-waybill/get-saleWaybill-page",
    method: "GET",
    params,
  });
}

// 销售运单-取消操作
export function editSaleWaybill(data) {
  return request({
    url: "/queue/sale-waybill/saleWaybill-edit",
    method: "POST",
    data,
  });
}

// 销售运单-通过id查询产品列表
export function findProCusRelName(params) {
  return request({
    url: "/queue/sale-waybill/find-proCus-relName",
    method: "GET",
    params,
  });
}

// 销售运单-通过id查询卸货地列表
export function findcusAddressbyCusId(params) {
  return request({
    url: "/queue/sale-waybill/find-cusAddress-byCusId",
    method: "GET",
    params,
  });
}

// 销售运单-审核通过
export function saleWaybillAudit(data) {
  return request({
    url: "/queue/sale-waybill/saleWaybill-audit",
    method: "POST",
    data,
  });
}

// 销售运单-查询详情
export function getSaleWaybillbyId(params) {
  return request({
    url: "/queue/sale-waybill/get-saleWaybill-byId",
    method: "GET",
    params,
  });
}

// 采购运单-取消操作
export function cancelWaybillLation(data) {
  return request({
    url: "/queue/waybill/cancellation",
    method: "PUT",
    data,
  });
}
// 获取派车单数据
export function getBingddingWaybill(data) {
  return requestFy({
    url: `/coal-bidding/get-coal-bidding/app`,
    method: "POST",
    data,
  });
}
